package com.zjnx.train.service.impl;

import java.util.List;

import org.extremecomponents.table.limit.Limit;

import com.zjnx.train.dao.UserDao;
import com.zjnx.train.entity.User;
import com.zjnx.train.service.UserService;

/**
 * @author foo
 * @email foo@zjnx.com
 * @description:service接口实现
 */
public class UserServiceImpl implements UserService {
    private UserDao userDao;

    public void setUserDao(UserDao userDao) {
        this.userDao = userDao;
    }

    @Override
    public void save(User user) {
        userDao.save(user);
    }

    @Override
    public void update(User user) {
        userDao.update(user);
    }

    @Override
    public void delete(Long id) {
        userDao.delete(id);
    }

    @Override
    public User findByKey(Long id) {
        return userDao.findByKey(id);
    }

    @Override
    public List<User> findAll() {
        return userDao.findAll();
    }

    @Override
    public List<User> listAll(Limit limit, String queryString, Object... values) {
        List<User> users = userDao.listAll(limit, queryString, values);
        return users;
    }

    @Override
    public List<User> listAll(Limit limit, User user) {
        return userDao.listAll(limit, user);
    }

}
